//
//  AnimeReducer.swift
//  MagaCore
//
//  Created by MrMessy on 2023/5/9.
//

import Foundation
import ReSwift

struct HTAnimeReducer {
	static var var_reducer: Reducer<HTAnimeState> {
		return { action, state in
			var state = state ?? HTAnimeState()
			guard let action = action as? HTEnumAnimeAction else {
				return state
			}
			switch action {
			case .htEnumHomeSubjects(var_subjects: let var_subjects):
				state.var_subjects = var_subjects
				return state
			case .htEnumSubjectList(var_subjectList: let var_subjectList):
				state.var_subjectList = var_subjectList
				return state
			case .htEnumAnimeInfo(var_animeAll: let var_animeAll):
				state.var_animeAll = var_animeAll
				return state
			case .htEnumAnimeUrls(var_animeUrls: let var_animeUrls):
				state.var_animeUrls = var_animeUrls
				return state
			}
		}
	}
}
